package org.ym.file.domain.common.enums;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 文件存储规则
 * @author ym
 */
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum FileStoreType {
    NORMAL(1, "正常存储"), ENCRYPTION(2, "Zip加密存储");
    /**
     * 代码
     */
    private final int code;
    /**
     * 名称
     */
    private final String name;

    public static FileStoreType of(int code) {
        switch (code) {
            case 1:
                return NORMAL;
            case 2:
                return ENCRYPTION;
        }
        return null;
    }
}
